package xerr

// ResCode 错误码
type ResCode uint32

/**(前3位代表业务,后三位代表具体功能)**/

// 公共部分
const (
	OK                ResCode = 200
	ServerBusyError   ResCode = 500
	ServerCommonError ResCode = 1000 + iota
	RequestParamError
	TokenExpireError
	TokenGenerateError
	DbError
	DbUpdateAffectedZeroError
	DateCopyError
	JsonUnmarshalError
	ParseReqError
	ValidatorReqError
	SqlConcatError
	CacheError
)

// 用户模块
const (
	UserNotfoundError ResCode = 100100 + iota
	UserRegisterError
	UserDeleteError
	UserUpdateError
	UserAliveError
	RoleNotfoundError
	RoleSurvivalError
	RoleAddError
	RoleDeleteError
	RoleUpdateError
	UserGetError
	UserLoginError
	UserPasswordError
	UserNotAdminError
	RoleHaveUserError
	RoleGetError
	UserCodeError
	UserCodeTooBusy
	UserCodeUnMatch
	UserCodeAuthError
)
